<template>
	<view>
		<u-swiper @change="change" :list="lun" :height="250" :effect3d="true" :interval="3000" @click="click(idd)">
		</u-swiper>
		<uni-group title="市民诉求分类">
			<swiper>
				<swiper-item>
					<view class="item-container">
						<view class="thumb-box" v-for="(item1, index1) in quan" v-if="index1<8" :key="index1"
							@click="dianji(item1.id)">
							<image class="item-menu-image" :src="base+item1.imgUrl" mode=""></image>
							<view class="item-menu-name">{{item1.name}}</view>
						</view>
					</view>
				</swiper-item>
				<swiper-item>
					<view class="item-container">
						<view class="thumb-box" v-for="(item1, index1) in quan" v-if="index1>8 & index1 <15"
							:key="index1" @click="dianji(item1.id)">
							<image class="item-menu-image" :src="base+item1.imgUrl" mode=""></image>
							<view class="item-menu-name">{{item1.name}}</view>
						</view>
						<view class="thumb-box" v-for="(item1, index1) in quan" v-if="index1 >14" @click="qita"
							:key="index1">
							<image class="item-menu-image" :src="base+item1.imgUrl" mode=""></image>
							<view class="item-menu-name">{{item1.name}}</view>
						</view>
					</view>
				</swiper-item>
			</swiper>
		</uni-group>
		<uni-group title="我的诉求">
			<uni-card v-for="(item,index) in myshu" title="" @click="xianq(item.id)">
				<view class="u-font-20">
					{{item.title}}
				</view>
				<view>承办单位:{{item.undertaker}}</view>
				<view>提交时间:{{item.createTime}}</view>
				<view>处理状态:{{item.state == 1?'已处理':'未处理'}}</view>
			</uni-card>
		</uni-group>
	</view>
</template>

<script>
	import api from 'commer/apiURL.js'
	export default {
		data() {
			return {
				lun: [],
				base: api.baseurl,
				quan: [],
				myshu: [],
			}
		},
		onLoad() {
			this.getlun()
			this.getlun2()
			this.getlun3()
		},
		methods: {
			xianq(id) {
				uni.navigateTo({
					url: 'xianq?id=' + id
				})
			},
			qita() {
				uni.navigateTo({
					url: 'xinshu'
				})
			},
			dianji(id) {
				uni.navigateTo({
					url: 'sulist?id=' + id
				})
			},
			getlun3() {
				this.$get(this.base + '/prod-api/api/gov-service-hotline/appeal/my-list').then((res) => {
					this.myshu = res.rows
				})
			},
			getlun() {
				this.$get(this.base + '/prod-api/api/gov-service-hotline/ad-banner/list').then((res) => {
					res.data.forEach((item) => {
						this.lun.push({
							image: this.base + item.imgUrl,
							id: item.targetId
						})
					})
				})
			},
			getlun2() {
				this.$get(this.base + '/prod-api/api/gov-service-hotline/appeal-category/list').then((res) => {
					this.quan = res.rows
				})
			},
			change() {},
		}
	}
</script>

<style>
	.item-container {
		display: flex;
		flex-wrap: wrap;
	}

	.thumb-box {
		width: 25%;
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		margin-top: 20rpx;
	}

	.item-menu-image {
		width: 60rpx;
		height: 60rpx;
	}
</style>
